/**
 * 数据模块
 */
import { service, paramsQuery } from './request';

// 总体数据
export function fetchDataTotal(param) {
  let ret = paramsQuery('/manage/api/bus/data/data_by_user', param);
  return service.post(ret.path, ret.body);
}

// 总体数据/导出报表
export function fetchDataExportTotal(param) {
  let ret = paramsQuery('/manage/api/bus/excel/data_by_user', param);
  return service.post(ret.path, ret.body);
}

// 广告计划/按天
export function fetchDataPlanDay(param) {
  let ret = paramsQuery('/manage/api/bus/data/plan_day', param);
  return service.post(ret.path, ret.body);
}

// 广告计划/按小时
export function fetchDataPlanHour(param) {
  let ret = paramsQuery('/manage/api/bus/data/plan_hour', param);
  return service.post(ret.path, ret.body);
}

// 广告单元/按天
export function fetchDataUnitDay(param) {
  let ret = paramsQuery('/manage/api/bus/data/unit_day', param);
  return service.post(ret.path, ret.body);
}

// 广告单元/按小时
export function fetchDataUnitHour(param) {
  let ret = paramsQuery('/manage/api/bus/data/unit_hour', param);
  return service.post(ret.path, ret.body);
}

// 广告创意/按天
export function fetchDataCreativeDay(param) {
  let ret = paramsQuery('/manage/api/bus/data/creative_day', param);
  return service.post(ret.path, ret.body);
}

// 广告创意/按小时
export function fetchDataCreativeHour(param) {
  let ret = paramsQuery('/manage/api/bus/data/creative_hour', param);
  return service.post(ret.path, ret.body);
}

// 广告创意/手动结算
export function fetchDataCreativeSettlement(param) {
  let ret = paramsQuery('/manage/api/balance_sync/sync', param);
  return service.post(ret.path, ret.body);
}

// 广告主数据
export function fetchDataAdvertiser(param) {
  let ret = paramsQuery('/manage/api/bus/data/user_day', param);
  return service.post(ret.path, ret.body);
}

// 广告主数据账户下拉
export function fetchDataAdvertiserAccount(param) {
  let ret = paramsQuery('/manage/api/bus/user/username_list', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/广告主
export function fetchDataExportAdvertiser(param) {
  let ret = paramsQuery('/manage/api/bus/excel/user_day', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/计划按天
export function fetchDataExportPlanDay(param) {
  let ret = paramsQuery('/manage/api/bus/excel/plan_day', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/计划按小时
export function fetchDataExportPlanHour(param) {
  let ret = paramsQuery('/manage/api/bus/excel/plan_hour', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/单元按天
export function fetchDataExportUnitDay(param) {
  let ret = paramsQuery('/manage/api/bus/excel/unit_day', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/单元按小时
export function fetchDataExportUnitHour(param) {
  let ret = paramsQuery('/manage/api/bus/excel/unit_hour', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/创意按天
export function fetchDataExportCreativeDay(param) {
  let ret = paramsQuery('/manage/api/bus/excel/creative_day', param);
  return service.post(ret.path, ret.body);
}

// 导出报表/创意按小时
export function fetchDataExportCreativeHour(param) {
  let ret = paramsQuery('/manage/api/bus/excel/creative_hour', param);
  return service.post(ret.path, ret.body);
}